From 28e1ed4f2aac4a362043437f1495d1dc8d5f5875 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 1 Jul 2015 23:36:29 -0700 Subject: [PATCH] Fix warnings in the font options code This code gets called before a screen is set. --- gtk/gtkwidget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index f537433418..92e0dc5f83 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -10336,7 +10336,7 @@ update_pango_context (GtkWidget *widget, 100)); screen = gtk_widget_get_screen_unchecked (widget); - if (widget->priv->font_options) + if (screen && widget->priv->font_options) { cairo_font_options_t *options; @@ -10345,7 +10345,7 @@ update_pango_context (GtkWidget *widget, pango_cairo_context_set_font_options (context, options); cairo_font_options_destroy (options); } - else + else if (screen) { pango_cairo_context_set_font_options (context, gdk_screen_get_font_options (screen)); -- 2.30.2